package com.liu.demo.service;

import com.liu.demo.pojo.Student;
import com.liu.demo.pojo.Teacher;
import com.liu.demo.prository.StudnetPrository;
import com.liu.demo.pojo.Student;
import com.liu.demo.prository.StudnetPrository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface StudentService {

    List<Student> findAll();

    List<Student> findByName(String name);

    //按id查找
    Student findByIdLike(Integer id);

    //增加信息
    void insertOne(Student student);

    //更新信息
    void updateOne(Student student);

    //删除信息
    void deleteOne(Student student);

    //只支持分页的查询
    Page<Student> findAll(Pageable pageable);

    //分页按照给定例子查询
    Page<Student> findAll(Example<Student> student, Pageable pageable);

    //按照名字和学号查找
    Student findByNameAndId(String name,Integer id) throws Exception;
}
